package com.nineclock.system.feign;


import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("sys-service")
public interface SysOrganizationFeign {

    /**
     * @Author: lenovo
     * @Date: 12:05 2021/7/10
     * @Description: 查询企业ID下的所有顶级部门ID
    */
    @GetMapping("/organization/department/top")
    public Result<List<Long>> queryDepartmentIds();

    /**
     * 查询指定部门集合下员工的数量
     */
    @GetMapping("/organization/department/membernum")
    public Result<Integer> queryUserCountByDepartmentId(@RequestParam("departmentIds") List<Long> departmentIds);

    /**
     * @Author: lenovo
     * @Date: 9:31 2021/7/12
     * @Parms [companyUserId]
     * @ReturnType: com.nineclock.common.entity.Result<java.util.List<java.lang.Long>>
     * @Description: 根据员工id获得部门从低到高级别的部门ID数组
    */
    @GetMapping("/department/allDepId/{companyUserId}")
    public Result<List<Long>> queryDepartmentsByUserId(@PathVariable("companyUserId") Long companyUserId);

    @GetMapping("/organization/members/simple")
    public Result<List<SysCompanyUserDTO>> queryAllCompanyUser();
}
